#include<opencv2/opencv.hpp>
#include<iostream>

using namespace cv;
using namespace std;

int main()
{
    Mat img=imread("/home/lwj/opencv_projeci/1.png");
    Mat HSV;
    cvtColor(img,HSV,COLOR_RGB2HSV);
Mat hsv,imgc;
threshold(HSV,hsv,175,255,THRESH_BINARY);//原图，二值化后，阀值，最大阀值，图像类型
threshold(img,imgc,150,255,THRESH_TOZERO_INV);
Mat imgv0,imgv1,imgv2,r1;
vector<Mat>imgv;
split(HSV,imgv);
imgv0=imgv.at(0);
imgv1=imgv.at(1);
imgv2=imgv.at(2);
imshow("hsv",hsv);
imshow("原图",imgc);
//imgv.push_back(HSV);
merge(imgv,r1);
imshow("r1",r1);
imshow("b",imgv0);
    waitKey(0);
}


